package com.dragon.web.ykd.controller;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.dragon.app.commons.vo.JsonResult;
import com.dragon.app.ykd.service.AppUserService;

@Controller
@RequestMapping("${platform.name.code}")
public class AppUserController {
	@Autowired
	private AppUserService appUserService;
	
	/**
	 * 查询借款记录
	 * @param accessToken
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="/borrowList")
	public JsonResult<List<Map<String,String>>> borrowList(@RequestHeader String accessToken, @RequestHeader String idFintechUmUser){
		return appUserService.borrowList(accessToken, idFintechUmUser);
	}
	
	/**
	 * 根据loanid查看借据
	 * @param loanId
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="/queryDebt/{loanId}")
	public Object queryDebt(@PathVariable String loanId){
		return appUserService.queryDebt(loanId);
	}
	
}
